#include "colorpicker.h"
#include "colorpickerplugin.h"

#include <QtPlugin>

ColorPickerPlugin::ColorPickerPlugin(QObject *parent)
    : QObject(parent)
{
    m_initialized = false;
}

void ColorPickerPlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
    if (m_initialized)
        return;
    
    // Add extension registrations, etc. here
    
    m_initialized = true;
}

bool ColorPickerPlugin::isInitialized() const
{
    return m_initialized;
}

QWidget *ColorPickerPlugin::createWidget(QWidget *parent)
{
    return new ColorPicker(parent);
}

QString ColorPickerPlugin::name() const
{
    return QLatin1String("ColorPicker");
}

QString ColorPickerPlugin::group() const
{
    return QLatin1String("Input Widgets");
}

QIcon ColorPickerPlugin::icon() const
{
    return QIcon(QLatin1String(":/roue.png"));
}

QString ColorPickerPlugin::toolTip() const
{
    return QLatin1String("Color Picker");
}

QString ColorPickerPlugin::whatsThis() const
{
    return QLatin1String("");
}

bool ColorPickerPlugin::isContainer() const
{
    return false;
}

QString ColorPickerPlugin::domXml() const
{
    return QLatin1String("<widget class=\"ColorPicker\" name=\"colorPicker\">\n</widget>\n");
}

QString ColorPickerPlugin::includeFile() const
{
    return QLatin1String("colorpicker.h");
}

Q_EXPORT_PLUGIN2(colorpickerplugin, ColorPickerPlugin)
